package com.cskaoyan.util;

import com.cskaoyan.bean.order.wxbean.HandleOption;
import com.cskaoyan.bean.order.wxbean.OrderDetail;

/**
 * @author Hu
 * @create 2021-09-19 15:54
 * @Description
 */
public class HandleOptionUtil {


    public static HandleOption getHandleOptionByStatus(Integer statusNum) {
        HandleOption handleOption = new HandleOption();
        switch (statusNum) {
            case 101:
                handleOption.setCancel(true);
                handleOption.setPay(true);
                handleOption.setDelete(false);
                handleOption.setComment(false);
                handleOption.setRefund(false);
                handleOption.setRebuy(false);
                handleOption.setConfirm(false);
                handleOption.setAftersale(false);

                break;
            case 102:
            case 103:
                handleOption.setCancel(false);
                handleOption.setPay(false);
                handleOption.setDelete(true);
                handleOption.setComment(false);
                handleOption.setRefund(false);
                handleOption.setRebuy(true);
                handleOption.setConfirm(false);
                handleOption.setAftersale(false);
                break;
            case 201:
                handleOption.setCancel(false);
                handleOption.setPay(false);
                handleOption.setDelete(false);
                handleOption.setComment(false);
                handleOption.setRefund(true);
                handleOption.setRebuy(false);
                handleOption.setConfirm(false);
                handleOption.setAftersale(true);
                break;
            case 202:
                handleOption.setCancel(false);
                handleOption.setPay(false);
                handleOption.setDelete(false);
                handleOption.setComment(false);
                handleOption.setRefund(false);
                handleOption.setRebuy(false);
                handleOption.setConfirm(false);
                handleOption.setAftersale(false);
                break;
            case 203:
                handleOption.setCancel(false);
                handleOption.setPay(false);
                handleOption.setDelete(true);
                handleOption.setComment(false);
                handleOption.setRefund(false);
                handleOption.setRebuy(false);
                handleOption.setConfirm(false);
                handleOption.setAftersale(false);
                break;
            case 301:
                handleOption.setCancel(false);
                handleOption.setPay(false);
                handleOption.setDelete(false);
                handleOption.setComment(false);
                handleOption.setRefund(false);
                handleOption.setRebuy(false);
                handleOption.setConfirm(true);
                handleOption.setAftersale(false);
                break;
            case 401:
            case 402:
                handleOption.setCancel(false);
                handleOption.setPay(false);
                handleOption.setDelete(false);
                handleOption.setComment(true);
                handleOption.setRefund(false);
                handleOption.setRebuy(true);
                handleOption.setConfirm(false);
                handleOption.setAftersale(true);
                //if (marketOrder.getComments() == 0) {
                //            handleOption.setComment(false);
                //        }
//            需要添加    额外的评论验证
                break;
        }
        return handleOption;
    }

    public static String getStatusString(Integer statusNum) {
        switch (statusNum) {
            case 101:
                return "未付款";
            case 102:
                return "用户取消";
            case 103:
                return "系统取消";
            case 201:
                return "已付款";
            case 202:
                return "申请退款";
            case 203:
                return "已退款";
            case 301:
                return "已发货";
            case 401:
                return "用户收货";
            case 402:
                return "系统发货";
        }

        return null;

    }
}
